package com.pg.agent.engine.client.common.enums;

import java.util.Arrays;

/**
 * 对话处理类型，1：取消前一条回复，2：重新回答，3：重新编辑
 *
 * @author huhuaping
 * @date 2023/11/24 9:41
 */
public enum ChatTypeEnum {
    CANCEL(1, "1", "取消前一条回复"),
    REANSWER(2, "2", "重新回答"),
    REEDIT(3, "3", "重新编辑");

    /**
     * 值
     */
    private Integer value;
    /**
     * 编码
     */
    private String code;
    /**
     * 说明
     */
    private String desc;

    ChatTypeEnum() {

    }

    ChatTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    ChatTypeEnum(Integer value, String code, String desc) {
        this.value = value;
        this.code = code;
        this.desc = desc;
    }

    public static String getCodeByValue(Integer value) {

        ChatTypeEnum controllerTypeEnum = Arrays.stream(values()).filter(e -> e.value.equals(value)).findFirst().orElse(null);

        return controllerTypeEnum == null ? "" : controllerTypeEnum.code;
    }

    public Integer getValue() {
        return value;
    }


    public String getDesc() {
        return desc;
    }


    public String getCode() {
        return code;
    }


}
